{% extends "base_2col.html" %}
{% load i18n %}

{% block otherjs %}
<script type="text/javascript">
$(function(){
    $(".delop").click(function(){
        if (confirm("{% trans "delete the memeber's all records?" %}"))
        {
            var id=$(this).attr("id");
            id = id.split("del_op")[1];
            window.location.href = "/users/members/delete/" + id +"/";
        }
    })
});
</script>
{% endblock %}
{% block content %}
<h1>{% trans "manage members" %}</h1>

<span class="right_button">
    <a href="{% url add_member %}" >{% trans "add a new member" %}</a>
</span>
<div class="center_list">
    {% if families %}
    <ul class="common_list">
    {% for member in families %}
        <li>
            <span class="name">{{ member.family_name }}</span>
            <span class="relation">{{ member.get_relation_display }}</span>
            <span class="op">
                <a href="{% url edit_member member.id %}">{% trans "edit" %}</a>|
                <a  id="del_op{{ member.id }}" class="delop" href="javascript:void(0)">{% trans "delete" %}</a>
            </span>
        </li>
    {% endfor %}
    </ul>
    {% else %}
    {% trans "You don't have any member attached with your account." %}
    <a href="{% url add_member %}">{% trans "add a new member" %}</a>
    {% endif %}
</div>


{% endblock %}
